import {Injectable} from '@angular/core';

@Injectable()
export class DeepCopyTool {
  deepCopy(obj) {
    if (typeof obj != 'object') {
      return obj;
    }
    let newobj = {};
    for ( let attr in obj) {
      newobj[attr] = this.deepCopy(obj[attr]);
    }
    return newobj;
  }

}
